<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教务系统</title>
    <script src="node_modules/jquery/dist/jquery.js"></script>
    <script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>
    <script src="js/SC.js"></script>
    <script src="js/Student.js"></script>
    <script src="js/Course.js"></script>
    <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css">
</head>
<body onload="queryAllStudent()">
<nav>
    <div class="nav nav-tabs justify-content-center" id="nav-tab" role="tablist">
        <button class="nav-link active" id="nav-Student-tab" data-bs-toggle="tab" data-bs-target="#nav-Student"
                type="button" role="tab" aria-controls="nav-Student" aria-selected="true">Student
        </button>
        <button class="nav-link" id="nav-Course-tab" data-bs-toggle="tab" data-bs-target="#nav-Course" type="button"
                role="tab" aria-controls="nav-Course" aria-selected="false" onclick="queryAllCourse()">Course
        </button>
        <button class="nav-link" id="nav-SC-tab" data-bs-toggle="tab" data-bs-target="#nav-SC" type="button" role="tab"
                aria-controls="nav-SC" aria-selected="false" onclick="queryAllSC()">SC
        </button>
    </div>
</nav>
<div class="tab-content" id="nav-tabContent">
    <!--Student标签内容-->
    <div class="tab-pane fade show active" id="nav-Student" role="tabpanel" aria-labelledby="nav-Student-tab">
        <div class="card container">
            <div class="card-header">
                <div class="row">
                    <div class="col">
                        <!-- Button trigger modal -->
                        <button type="button" class="btn btn-outline-success" data-bs-toggle="modal"
                                data-bs-target="#addStudent_staticBackdrop">
                            添加
                        </button>

                        <button type="button" class="btn btn-outline-primary" onclick="updateStudentModal()">
                            修改
                        </button>

                        <button type="button" class="btn btn-outline-danger" onclick="deleteStudent()">
                            删除
                        </button>

                        <!-- Modal -->
                        <div class="modal fade" id="addStudent_staticBackdrop" data-bs-backdrop="static"
                             data-bs-keyboard="false" tabindex="-1" aria-labelledby="addStudent_staticBackdropLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="addStudent_staticBackdropLabel">添加Student</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!--添加Student的表单-->
                                        <form id="addStudentForm">
                                            <div class="row">
                                                <label for="addSno" class="col-form-label">Sno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSno" name="Sno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addSname" class="col-form-label">Sname</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSname" name="Sname">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addSsex" class="col-form-label">Ssex</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSsex" name="Ssex">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addSage" class="col-form-label">Sage</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSage" name="Sage">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addSdept" class="col-form-label">Sdept</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSdept" name="Sdept">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-outline-danger" data-bs-dismiss="modal">
                                            取消
                                        </button>
                                        <button type="button" class="btn btn-outline-primary" onclick="addStudent()">
                                            提交
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Modal -->
                        <div class="modal fade" id="updateStudent_staticBackdrop" data-bs-backdrop="static"
                             data-bs-keyboard="false" tabindex="-1" aria-labelledby="updateStudent_staticBackdropLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="updateStudent_staticBackdropLabel">修改Student</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!--更新Student的表单-->
                                        <form id="updateStudentForm">
                                            <div class="row">
                                                <label for="updateSno" class="col-form-label">Sno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSno" name="Sno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateSname" class="col-form-label">Sname</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSname"
                                                           name="Sname">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateSsex" class="col-form-label">Ssex</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSsex" name="Ssex">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateSage" class="col-form-label">Sage</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSage" name="Sage">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateSdept" class="col-form-label">Sdept</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSdept"
                                                           name="Sdept">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-outline-danger" data-bs-dismiss="modal">
                                            取消
                                        </button>
                                        <button type="button" class="btn btn-outline-primary" onclick="updateStudent()">
                                            更新
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-body">
                <table class="table table-hover" id="tableStudent">
                    <thead>
                    <tr>
                        <th scope="col">#</th>
                        <th scope="col">No.</th>
                        <th scope="col">Sno</th>
                        <th scope="col">Sname</th>
                        <th scope="col">Ssex</th>
                        <th scope="col">Sage</th>
                        <th scope="col">Sdept</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!--Course标签内容-->
    <div class="tab-pane fade" id="nav-Course" role="tabpanel" aria-labelledby="nav-Course-tab">
        <div class="card container">
            <div class="card-header">
                <div class="row">
                    <div class="col">
                        <!-- Button trigger modal -->
                        <button type="button" class="btn btn-outline-success" data-bs-toggle="modal"
                                data-bs-target="#addCourse_staticBackdrop">
                            添加
                        </button>

                        <button type="button" class="btn btn-outline-primary" onclick="updateCourseModal()">
                            修改
                        </button>

                        <button type="button" class="btn btn-outline-danger" onclick="deleteCourse()">
                            删除
                        </button>

                        <!-- Modal -->
                        <div class="modal fade" id="addCourse_staticBackdrop" data-bs-backdrop="static"
                             data-bs-keyboard="false" tabindex="-1" aria-labelledby="addCourse_staticBackdropLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="addCourse_staticBackdropLabel">添加Course</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!--添加Course的表单-->
                                        <form id="addCourseForm">
                                            <div class="row">
                                                <label for="addCno" class="col-form-label">Cno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addCno" name="Cno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addCname" class="col-form-label">Cname</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addCname" name="Cname">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addCpno" class="col-form-label">Cpno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addCpno" name="Cpno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addCcredit" class="col-form-label">Ccredit</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addCcredit"
                                                           name="Ccredit">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-outline-danger" data-bs-dismiss="modal">
                                            取消
                                        </button>
                                        <button type="button" class="btn btn-outline-primary" onclick="addCourse()">
                                            提交
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Modal -->
                        <div class="modal fade" id="updateCourse_staticBackdrop" data-bs-backdrop="static"
                             data-bs-keyboard="false" tabindex="-1" aria-labelledby="updateCourse_staticBackdropLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="updateCourse_staticBackdropLabel">修改Course</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!--更新Course的表单-->
                                        <form id="updateCourseForm">
                                            <div class="row">
                                                <label for="updateCno" class="col-form-label">Cno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateCno" name="Cno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateCname" class="col-form-label">Cname</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateCname"
                                                           name="Cname">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateCpno" class="col-form-label">Cpno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateCpno" name="Cpno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateCcredit" class="col-form-label">Ccredit</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateCcredit"
                                                           name="Ccredit">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-outline-danger" data-bs-dismiss="modal">
                                            取消
                                        </button>
                                        <button type="button" class="btn btn-outline-primary" onclick="updateCourse()">
                                            更新
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-body">
                <table class="table" id="tableCourse">
                    <thead>
                    <tr>
                        <th scope="col">#</th>
                        <th scope="col">No.</th>
                        <th scope="col">Cno</th>
                        <th scope="col">Cname</th>
                        <th scope="col">Cpno</th>
                        <th scope="col">Ccredit</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <!--SC标签内容-->
    <div class="tab-pane fade" id="nav-SC" role="tabpanel" aria-labelledby="nav-SC-tab">
        <div class="card container">
            <div class="card-header">
                <div class="row">
                    <div class="col">
                        <!-- Button trigger modal -->
                        <button type="button" class="btn btn-outline-success" data-bs-toggle="modal"
                                data-bs-target="#addSC_staticBackdrop">
                            添加
                        </button>

                        <button type="button" class="btn btn-outline-primary" onclick="updateSCModal()">
                            修改
                        </button>

                        <button type="button" class="btn btn-outline-danger" onclick="deleteSC()">
                            删除
                        </button>

                        <!-- Modal -->
                        <div class="modal fade" id="addSC_staticBackdrop" data-bs-backdrop="static"
                             data-bs-keyboard="false" tabindex="-1" aria-labelledby="addSC_staticBackdropLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="addSC_staticBackdropLabel">添加SC</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!--添加SC的表单-->
                                        <form id="addSCForm">
                                            <div class="row">
                                                <label for="addSCSno" class="col-form-label">Sno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSCSno" name="Sno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addSCCno" class="col-form-label">Cno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addSCCno" name="Cno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="addGrade" class="col-form-label">Grade</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="addGrade" name="Grade">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-outline-danger" data-bs-dismiss="modal">
                                            取消
                                        </button>
                                        <button type="button" class="btn btn-outline-primary" onclick="addSC()">
                                            提交
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- Modal -->
                        <div class="modal fade" id="updateSC_staticBackdrop" data-bs-backdrop="static"
                             data-bs-keyboard="false" tabindex="-1" aria-labelledby="updateSC_staticBackdropLabel"
                             aria-hidden="true">
                            <div class="modal-dialog modal-dialog-centered">
                                <div class="modal-content">
                                    <div class="modal-header">
                                        <h5 class="modal-title" id="updateSC_staticBackdropLabel">修改SC</h5>
                                        <button type="button" class="btn-close" data-bs-dismiss="modal"
                                                aria-label="Close"></button>
                                    </div>
                                    <div class="modal-body">
                                        <!--更新SC的表单-->
                                        <form id="updateSCForm">
                                            <div class="row">
                                                <label for="updateSCSno" class="col-form-label">Sno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSCSno" name="Sno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateSCCno" class="col-form-label">Cno</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateSCCno"
                                                           name="Cno">
                                                </div>
                                            </div>
                                            <div class="row">
                                                <label for="updateGrade" class="col-form-label">Grade</label>
                                                <div class="col">
                                                    <input type="text" class="form-control" id="updateGrade"
                                                           name="Grade">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-outline-danger" data-bs-dismiss="modal">
                                            取消
                                        </button>
                                        <button type="button" class="btn btn-outline-primary" onclick="updateSC()">
                                            更新
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-body">
                <table class="table" id="tableSC">
                    <thead>
                    <tr>
                        <th scope="col">#</th>
                        <th scope="col">No.</th>
                        <th scope="col">Sno</th>
                        <th scope="col">Cno</th>
                        <th scope="col">Grade</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
</html>